package org.sbpme.process;

import java.io.Serializable;
import java.util.HashMap;

import org.sbpme.process.model.Node;
import org.sbpme.process.model.node.Activity;

public class ProcessImpl extends org.sbpme.process.model.Process {

    private String id;
    private HashMap<String, Class<? extends Serializable>> variables;
    private HashMap<String, Node> nodeIdNodeMap;
    private Activity startActivity;
    
    public ProcessImpl(String id, Activity startActivity) {
	this.id = id;
	this.startActivity = startActivity;
	this.variables = new HashMap<String, Class<? extends Serializable>>();
	this.nodeIdNodeMap = new HashMap<String, Node>();
    }
    
    public Activity getStartActivity() {
	return startActivity;
    }
    
    public void addVariable(String name, Class<? extends Serializable> clazz) {
	this.variables.put(name, clazz);
    }
    
    public void addNode(String id, Node node) {
	this.nodeIdNodeMap.put(id, node);
    }

    public Node getNode(String id) {
	return this.nodeIdNodeMap.get(id);
    }
}
